package com.sixth.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sixth.dao.InventoryDao;
import com.sixth.dao.InventoryGoodsDao;
import com.sixth.entity.InventoryGoods;
import com.sixth.service.InventoryGoodsService;
import com.sixth.util.TableLayUi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @program: project01
 * @description:
 * @author: 高振杨
 * @create: 2021-12-23 15:20
 **/
@Service(value = "inventorygoodsservice")
public class InventoryGoodsServiceImpl implements InventoryGoodsService {
    @Autowired
    private InventoryGoodsDao dao;

    public TableLayUi getInventoryGoods(int page, int limit, Integer invenid) {
        PageHelper.startPage(page,limit);
        List<Map> goods = dao.getInventoryGoods(invenid);
        PageInfo<Map> pageInfo = new PageInfo<Map>(goods);
        return new TableLayUi(0,"",pageInfo.getTotal(),pageInfo.getList());
    }
}
